using System;
using System.Drawing;
using System.Windows.Forms;
using PluginCore;

namespace haxeProject {
	
	public class Icon {
		public int index;
		public Image image;
		
		public Icon( Image img, int idx ) {
			index = idx;
			image = img;
		}
	}
	
	public class Icons
	{
		private static IMainForm mainForm;
		public static ImageList list;

		public static Icon inull = new Icon(null,0);
		
		// icons of panels
		public static Icon PANEL = inull;
		public static Icon FPANEL = inull;

		// icons of main menu
		public static Icon MENU_BUILD = inull;
		public static Icon MENU_TEST = inull;
		public static Icon MENU_TESTBUILD = inull;
	
		// generic icons
		public static Icon NEW = inull;
		public static Icon OPEN = inull;
		public static Icon REMOVE = inull;
		public static Icon RENAME = inull;
		
		// icons of output explorer
		public static Icon OUTPUT = inull;
		public static Icon CUR_OUTPUT = inull;
		
		// icons of file explorer
		public static Icon FILE_FOLDER = inull;
		public static Icon FILE_SOURCE = inull;

		// completion tip
		public static Icon TIP_METHOD = inull;
		public static Icon TIP_MEMBER = inull;

		public static void Init( IMainForm mf ) {
			list = new ImageList();
			list.ColorDepth = ColorDepth.Depth32Bit;
			list.ImageSize = new Size(16, 16);
			list.TransparentColor = Color.Transparent;
	
			mainForm = mf;
			PANEL = Get(66);
			FPANEL = Get(141);
			
			NEW = Get(0);
			OPEN = Get(1);
			REMOVE = Get(19);
			
			OUTPUT = Get(10);
			CUR_OUTPUT = Get(17);
			
			FILE_FOLDER = Get(84);
			FILE_SOURCE = Get(117);
			
			MENU_BUILD = Get(21);
			MENU_TEST = Get(23);
			MENU_TESTBUILD = Get(21);
			
			TIP_MEMBER = Get(14);
			TIP_METHOD = Get(20);
		}

		public static Icon Get( int index ) {
			Image img = mainForm.GetSystemImage(index);
			list.Images.Add(img);
			return new Icon(img,list.Images.Count - 1);
		}
	}
}
